//
//  DetailViewController.m
//  TodoDemo
//
//  Created by Tank on 16/2/21.
//  Copyright © 2016年 qtone. All rights reserved.
//

#import "DetailViewController.h"

@interface DetailViewController()

@property (weak, nonatomic) IBOutlet UILabel *detailLbl;
@property (weak, nonatomic) IBOutlet UIButton *doneBtn;

@end

@implementation DetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    _detailLbl.text = self.todoDetailModel.content;
    if ([self.todoDetailModel.status intValue] == kTodoStatusFinished) {
        _doneBtn.hidden = YES;
    }
}

- (IBAction)doneAction:(id)sender {
    _todoDetailModel.status = @(kTodoStatusFinished);
    [self.delegate doneTodoData:_todoDetailModel indexPath:_indexPath];
    [self.navigationController popViewControllerAnimated:YES];
}

- (IBAction)delAction:(id)sender {
    _todoDetailModel.status = @(kTodoStatusDeleted);
    [self.delegate deleteTodoData:_todoDetailModel indexPath:_indexPath];
    [self.navigationController popViewControllerAnimated:YES];
}


@end
